<%@page import="com.team.dao.UserDao"%>
<%@page import="com.team.entity.Project"%>
<%@ page import="com.team.entity.User" %>
 <%@ page import="com.team.util.Const" %>
 
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.team.util.Const"  %>
<%@ page import="com.team.entity.Message" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>最新动态</title>
	<link rel="stylesheet" href="css/prettify.css" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
</head>
<body class="body">
<% 
	User user = (User)session.getAttribute(Const.SESSION_USER); 
 %>
 
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">凯盛项目管理系统</a>
				 <ul class="nav pull-right">
						<li><a class="nav pull-right" href="#"> 用户名：<%=user.getUsername() %></a></li>
				 </ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
				<div class="span3">
				<%
					Project project = (Project)session.getAttribute(Const.SESSION_PROJ);
				 %>
					<div class="well" style="padding: 8px 0;">
						<ul class="nav nav-list">
						  <li class="nav-header"><%=project.getProjName() %></li>
						  <li class="divider"></li>
						  <li class="active"><a href="info.jspx?_m=select&projId=<%=project.getId() %>"><i class=" icon-white icon-home"></i>最新动态</a></li>
						  <li><a href="addGoal.jspx?_m=select"><i class="icon-flag"></i>目标</a></li>
						  <li><a href="docShare.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-folder-open"></i>资料库</a></li>
						  <li><a href="fileshare.jsp"><i class="icon-file"></i>文件共享</a></li>
						  <li><a href="newContact.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-user"></i>联系人</a></li>
						  <li><a href="newIdea.jspx?_m=select&id=<%=project.getId() %>"><i class="icon-fire"></i>想法</a></li>
						  <li><a href="findBug.jsp"><i class="icon-warning-sign"></i>Bug</a></li>
						  <li><a href="projReset.jsp"><i class="icon-cog"></i>项目设置</a></li>
						</ul>
					</div>
				</div>
			<div class="span6">
				<ul style="margin-bottom:0px;border-radius: 3px 3px 0 0;" class="breadcrumb">
					<li class="active">
						<i class="icon-th"></i>你在想什么？
					</li>
				</ul>
				<div class="wall">
					<form style="margin:0px" action="info.jspx?_m=save&projId=<%=project.getId() %>" method="post">
						<textarea rows="3" style="width:415px" id="" name="info"></textarea>
						<button class="btn btn-primary">发布</button>
					</form>
				</div>
				<ul style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:20px" class="breadcrumb">
					<li class="active">
						<i class="icon-th"></i>信息流
					</li>
				</ul>
				<%
				List<Message> list = (List<Message>)application.getAttribute(Const.APPLICAION_MESSAGE);
				if(list == null){
				 %>
				 <div style="color:red;">
				 	没有记录
				 </div>
				 <%}else {
				 	for(Message mess:list){
				 	UserDao  ud = new UserDao();
				 	User messUser = ud.selectById(mess.getUserId());
				  %>
				<div class="wall">
					<span ><%=messUser.getUsername() %> </span>&nbsp;&nbsp;&nbsp;&nbsp;<span><%=mess.getCreateTime() %></span>
					<p><%=mess.getContent() %></p>
				</div>
				<%} }%>
			</div>
			<div class="span3">
				<div class="well" style="padding: 8px 0;">
					<ul class="nav nav-list">
					  <li class="nav-header">用户任务</li>
					  <li class="divider"></li>
					  <%
					   %>
					  <span><i class=" icon-book"></i>任务一</span>
					</ul>
				</div>
			</div>	
		</div>
	</div>
</body>
</html>